package org.mf.service.impl;

import java.util.List;

import org.mf.dao.UserDAO;
import org.mf.domain.User;
import org.mf.service.UserService;
import org.mf.web.pagination.PagedResultSet;
import org.mf.web.pagination.Pager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service("userService")
@Transactional
public class UserServiceImpl implements UserService {
	private UserDAO userDao;

	@Autowired
	public UserServiceImpl(UserDAO userDao) {
		this.userDao = userDao;
	}

	public Integer getAllCount() {
		return userDao.getAllCount();
	}

	public User get(Long id) {
		return userDao.get(id);
	}

	public List<User> getAll(Pager pager) {
		return userDao.getAll(pager);
	}

	public void save(User user) {
		userDao.save(user);
	}

	public void delete(User user) {
		userDao.delete(user);
	}

	public PagedResultSet getPagedResults(Pager pager) {
		return userDao.getPagedResults(pager);
	}

}
